require "skynet.manager"
local skynet = require "skynet"
require "setting"
local gameName = "zhongfabai"
local zfb_robotMgr = require(gameName..".zfb_robotMgr")
local Message = require(gameName..".Message")
local Objects = require "Objects"



math.randomseed(tostring(os.time()):reverse():sub(1, 6))
g_objects = Objects.new()


function init()		
	local message = Message.new()
	local zfb_robotMgr = zfb_robotMgr.new(message)

	local name = skynet.getenv("robot_name")
	print("#############机器人###########"..name)
	local svr_config = robot_setting[name]
	skynet.newservice("debug_console",svr_config.debug_port)
	g_objects:add(zfb_robotMgr)
	g_objects:add(message)
	g_objects:hotfix(gameName)
	skynet.dispatch("lua", message:dispatch())
end
print("zfb _____main___________")
skynet.start(function()
	init()
	skynet.register(gameName)
end)